<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
	request.setCharacterEncoding("utf-8");
	String inum = request.getParameter("inum");
	int symbol = 0;
	if (inum.indexOf('+') != -1) {
		symbol = inum.indexOf('+');
	} else if (inum.indexOf('-') != -1) {
		symbol = inum.indexOf('-');
	} else if (inum.indexOf('*') != -1) {
		symbol = inum.indexOf('*');
	} else if (inum.indexOf('/') != -1) {
		symbol = inum.indexOf('/');
	}
	String strN1 = inum.substring(0, symbol);
	String strN2 = inum.substring(symbol + 1, inum.length());
	%>


	<%
	try {
		int n1 = Integer.parseInt(strN1);
		int n2 = Integer.parseInt(strN2);
		String s = String.valueOf(inum.charAt(symbol));
		if ("+".equals(s)) {
			out.println(inum + "=");
	%>
	<%=n1 + n2%>
	<%
	} else if ("-".equals(s)) {
	out.println(inum + "=");
	%>
	<%=n1 - n2%>
	<%
	} else if ("*".equals(s)) {
	out.println(inum + "=");
	%>
	<%=n1 * n2%>
	<%
	} else if ("/".equals(s)) {

	if (n2 == 0) {
		out.println("数字错误,请重试! ");
	} else {
		out.println(inum + "=");
	%>
	<%=n1 / n2%>
	<%
	}
	}
	} catch (Exception e) {
	out.println("格式有错，请重试！");

	}
	%>













</body>
</html>